const mongoose = require('mongoose')

const commentSchema = new mongoose.Schema({
    name: {
        type: String,match: /^[a-zA-Z0-9_]{3,32}$/ 
    },
    email: {
        type: String , match: /^[a-zA-Z0-9_.]+@[a-zA-Z0-9_.]+$/
    },
    comment: {
        type: String , maxlength: 128
    },
    imageid: mongoose.Schema.Types.ObjectId
},{timestamps: true})

mongoose.model('Comment',commentSchema,'comments')